import axios from '../tools/index.js'

export function getBanner () {
  return axios.get('/banner')
}

export function getKind (ops) {
  return axios.get('/pro/kind', {
    params: ops
  })
}

export function getPro (ops) {
  return axios.get('/pro/page', {
    params: ops
  })
}

export function getDetail (ops) {
  return axios.get('/pro/detail', {
    params: ops
  })
}

export function sendCode (ops) {
  return axios.get('/user/sendSmS', {
    params: ops
  })
}

export function register (ops) {
  return axios.post('/user/register', ops)
}

export function login (ops) {
  return axios.get('/user/login', {
    params: ops
  })
}

export function addCart (ops) {
  return axios.post('/cart/add', ops)
}

export function getCart () {
  return axios.get('/cart')
}

export function setNum (ops) {
  return axios.post('/cart/update/num', ops)
}

export function setFlag (ops) {
  return axios.post('/cart/update/flag', ops)
}

export function delCart (ops) {
  return axios.post('/cart/del', ops)
}

export function setAllFlag (ops) {
  return axios.post('/cart/update/allFlag', ops)
}

export function addOrder (ops) {
  return axios.post('/order/add', ops)
}

export function getOrder () {
  return axios.get('/order/all')
}

export function getOrderDetail (ops) {
  return axios.get('/order/one', {
    params: ops
  })
}

export function setOrder (ops) {
  return axios.post('/order/set', ops)
}

export function addSearch (ops) {
  return axios.post('/search/add', ops)
}

export function getSearch () {
  return axios.get('/search')
}

export function delSearch (ops) {
  return axios.post('/search/del', ops)
}

export function search (ops) {
  return axios.get('/pro/search', {
    params: ops
  })
}

export function getBrand (ops) {
  return axios.get('/pro/brand', {
    params: ops
  })
}

export function getUser () {
  return axios.get('/user/get')
}

export function setAvatar (ops) {
  return axios.post('/user/setAvatar', ops)
}

export function setUser (ops) {
  return axios.post('/user/set', ops)
}
